home
***
CD-ROM
|
disk
|
other
***
search
/
SGI Hot Mix 8
/
Hot Mix 8.iso
/
.all
/
demos
/
Soft_Win
/
InstallIt2
(
.txt
)
< prev
next >
Wrap
Text File
|
1994-06-22
|
16KB
|
540 lines
#!/bin/sh
# installit2
#
# Derived from: Template supplied by SGI for hot mix installation
# and the SoftPC HotMix scripts.
#
# Author: Anthony Shaughnessy
#
# Created on: 7th April 1994
#
# Sccs ID: @(#)installit2.sh 1.13 4/26/94
#
# Coding Stds.: 2.0
#
# Purpose: To act as a wrapper for the installation process from
# the hot mix CD. This script is called from InstallIt
# which opens a window as root to run this script in.
# This script asks various questions, calls instwrap
# which runs inst and supplies its input, and
# can optionally check your floppy drive and CD drive
# to see if it is configured correctly for SoftWindows
# - i.e. no msdosd or mediad running on it.
#
# We must first find out whether to use msdosd or mediad for floppy status
# checks. We do this here so the getfloppy() function can print out the
# correct message.
if test -x /usr/etc/mediad
then
CD_MEDIAPROG=/usr/etc/mediad
FLOP_MEDIAPROG=/usr/etc/mediad
CD_MEDIAPROGNAME=mediad
FLOP_MEDIAPROGNAME=mediad
else
CD_MEDIAPROG=/usr/etc/cdromd
FLOP_MEDIAPROG=/usr/etc/msdosd
CD_MEDIAPROGNAME=cdromd
FLOP_MEDIAPROGNAME=msdosd
fi
# getyesno() function to get a yes or no answer and no other from the user.
# Loops until user has entered valid input. Returns the answer in $ANSWER
# as either yes or no.
# Accepts either y, n, yes, or no, in any mix of case.
getyesno(){
while read ANSWER
do
ANSWER=`echo $ANSWER | tr '[A-Z]' '[a-z]'`
case $ANSWER in
y|yes)
ANSWER=yes
break
;;
n|no)
ANSWER=no
break
;;
*)
echo "You must answer yes or no : \c"
esac
done
}
# Exit this script, displaying the message passed in $1, and asking the user
# to press return before quitting.
exit_wrapper(){
echo "\n$1"
echo "\nPress enter to exit this window...\c "
read ans
exit 1
}
# Ask the user for a floppy device name. Allow a blank name - this means
# that no checking for msdosd or mediad will be done.
# Loops until either valid input is obtained, or a blank name is input.
# The user can enter an incomplete pathname, in which case the script will
# prepend first /dev, and then /dev/rdsk to try and find the file, which must
# be readable and be a character special file.
getfloppy(){
# Check that the FLOP_MEDIAPROG variable is set to something.
if test -z "$FLOP_MEDIAPROG"
then
return
fi
echo "\nTo use your floppy drive with SoftWindows, the $FLOP_MEDIAPROGNAME daemon must
not be running on that floppy drive. So that I can check whether the
$FLOP_MEDIAPROGNAME daemon is running on the floppy drive, please enter the name of
the floppy device you will be using with SoftWindows and press enter.
If you do not specify any device, then no checking will be done.
On an Indigo Enter /dev/rdsk/fds0d2.3.5hi for the middle slot,
or /dev/rdsk/fds0d3.3.5hi for the top slot.
On an Indy Enter /dev/rdsk/fds0d2.3.5hi."
while echo "Please enter the floppy device name : \c"
do
read FLOPPY
# first test for blank entry - break if blank
if test -z "$FLOPPY"
then
break
fi
# Look for the file. If you can't find it as $FLOPPY
# then look for it as /dev/$FLOPPY, and then /dev/rdsk/$FLOPPY
if test ! -r "$FLOPPY"
then
if test ! -r /dev/"$FLOPPY"
then
if test ! -r /dev/rdsk/"$FLOPPY"
then
echo "Floppy device $FLOPPY does not exist or is not readable."
continue
else
FLOPPY="/dev/rdsk/$FLOPPY"
fi
else
FLOPPY="/dev/$FLOPPY"
fi
fi
if test ! -c "$FLOPPY"
then
echo "The floppy device $FLOPPY must be a character special device."
else
echo "\nUsing device name $FLOPPY"
break
fi
done
}
# Ask the user for a CD device name. Allow a blank name - this means
# that no checking for cdromd or mediad will be done.
# Loops until either valid input is obtained, or a blank name is input.
# The user can enter an incomplete pathname, in which case the script will
# prepend first /dev, and then /dev/scsi to try and find the file, which must
# be readable and be a character special file.
getcdrom(){
# Check that the CD_MEDIAPROG variable is set to something.
if test -z "$CD_MEDIAPROG"
then
return
fi
echo "\nTo use your CD-ROM drive with SoftWindows, the $CD_MEDIAPROGNAME daemon must
not be running on that CD-ROM drive. So that I can check whether the
$CD_MEDIAPROGNAME daemon is running on the CD-ROM drive, please enter the name of
the CD-ROM device you will be using with SoftWindows and press enter.
If you do not specify any device, then no checking will be done.
The CD ROM device name should be of the form /dev/scsi/sc0dxl0, where x is
the SCSI address of the CD drive (between 0 and 7)."
while echo "Please enter the CD-ROM device name : \c"
do
read CDROM
# first test for blank entry - break if blank
if test -z "$CDROM"
then
break
fi
# Look for the file. If you can't find it as $CDROM
# then look for it as /dev/$CDROM, and then /dev/scsi/$CDROM
if test ! -r "$CDROM"
then
if test ! -r /dev/"$CDROM"
then
if test ! -r /dev/scsi/"$CDROM"
then
echo "CD-ROM device $CDROM does not exist or is not readable."
continue
else
CDROM="/dev/scsi/$CDROM"
fi
else
CDROM="/dev/$CDROM"
fi
fi
if test ! -c "$CDROM"
then
echo "The CD-ROM device $CDROM must be a character special device."
else
echo "\nUsing device name $CDROM"
break
fi
done
}
echo "Before continuing, you must have obtained a demo license from Insignia."
echo "Have you done this? y/n : \c"
getyesno
test $ANSWER = no && {
exit_wrapper "You must obtain a demo license before installing SoftWindows.
USA customers please call 800 848 7677.
European customers please call +44 494 459 426
All other customers please call +1 415 694 7677"
}
echo "\nInstalling SoftWindows. This may take a little while.
Please wait until prompted before typing anything."
# Call instwrap which will run inst and supply the input to inst so that the
# user doesn't have to type anything.
$SOFTWINDIR/instwrap $SOFTWINDIR
ERRCODE=$?
test $ERRCODE -ne 0 && {
exit_wrapper "SoftWindows was not installed correctly"
}
# Make sure that SoftWindows is there now - we can't trust the error code
# returned by instwrap, so we double check
# Check each package in turn. If the core package is not installed, then exit.
# If any of the others are not there, then just give a message.
if versions swin.sw.eoe | grep "Nothing satisfies" > /dev/null
then
exit_wrapper "The SoftWindows core package was not installed correctly.
You will not be able to run SoftWindows."
fi
MISSING_PACKAGE=false
if versions swin.man.eoe | grep "Nothing satisfies" > /dev/null
then
echo "The SoftWindows manual pages have not been installed."
MISSING_PACKAGE=true
fi
if versions swin.man.relnotes | grep "Nothing satisfies" > /dev/null
then
echo "The SoftWindows release notes package was not installed.
See the README files in /usr/lib/SoftWindows for release notes instead."
MISSING_PACKAGE=true
fi
if versions swin.sw.windows | grep "Nothing satisfies" > /dev/null
then
echo "The MS Windows installation files have not been installed.
You will still be able to use the pre-installed Windows disk to run MS Windows."
MISSING_PACKAGE=true
fi
if versions swin.sw.local | grep "Nothing satisfies" > /dev/null
then
echo "The Fonts and Localisation package has not been installed.
You will be able to run SoftWindows on your SGI machine, but may not be able
to use any other display servers."
MISSING_PACKAGE=true
fi
if test $MISSING_PACKAGE = true
then
echo "\nNot all of the ancillary SoftWindows packages have been installed,
but the core package has been installed successfully, and you will be able to
run SoftWindows"
fi
if test -n "$FLOP_MEDIAPROG"
then
# Get the floppy drive device name. Allow blank entry
getfloppy
SKIP=false
# If floppy device name entered, then do msdosd or mediad checks.
if test $FLOPPY
then
# Get the floppy status with msdosd -q or mediad -q
# The return status is a bit mask. See the msdosd or
# mediad man page.
$FLOP_MEDIAPROG -q $FLOPPY
RETVAL=$?
# The bit program will set environment variables
# called BIT[0123]SET to either true or false depending
# on whether the corresponding bit is set.
eval `$SOFTWINDIR/bit $RETVAL`
# We now have the variables BIT[0123]SET set to either true
# or fale
# Bit 0 means error occurred
if test $BIT0SET = true
then
echo "\nAn error occurred while investigating the status of the floppy drive.
No checking on the floppy status will be done.
You may need to kill the $FLOP_MEDIAPROGNAME daemon manually."
elif test $RETVAL -ne 0
then
# Bit 1 means msdosd or mediad is running for that
# device
if test $BIT1SET = true
then
echo "\nDo you want to kill the $FLOP_MEDIAPROGNAME daemon attached to $FLOPPY ? (y/n): \c"
getyesno
if test $ANSWER = yes
then
if test $FLOP_MEDIAPROG = /usr/etc/msdosd
then
$FLOP_MEDIAPROG -k $FLOPPY
else
$FLOP_MEDIAPROG -k
fi
echo "Waiting for $FLOP_MEDIAPROGNAME to die..."
sleep 5
else
SKIP=true
fi
fi
if test $SKIP = false
then
# We have to test bit 3 before bit 2, because if the
# floppy has been mounted manually, then bit 2 will not
# be set even if there is an fsd.auto entry. So we
# do another msdosd -q to see if the floppy has been
# unmounted, and use the return value of that to check
# for the fsd.auto entry.
# NOTE that bit 3 is not set when using mediad, so we
# have to check by running mount.
# Bit 3 means the floppy has been mounted manually
if test $BIT3SET = true || mount | grep $FLOPPY > /dev/null 2>&1
then
echo "\nThe floppy device $FLOPPY has been mounted manually.
Would you like it unmounted? (y/n): \c"
getyesno
if test $ANSWER = yes
then
umount $FLOPPY
$FLOP_MEDIAPROG -q $FLOPPY
RETVAL=$?
eval `$SOFTWINDIR/bit $RETVAL`
if test $BIT3SET = true || mount | grep $FLOPPY > /dev/null 2>&1
then
echo "\nThe unmount of the floppy device $FLOPPY failed.
You will need to unmount the floppy manually to use it with SoftWindows,
or you may access it as an FSA drive instead."
SKIP=true
fi
else
echo "\nIf you wish to use this floppy drive with SoftWindows, you must either
unmount it manually, or you may use it as an FSA drive instead."
SKIP=true
fi
fi
if test $SKIP = false
then
# Bit 2 means there is an /etc/fsd.auto entry
# but we have to check to see if mon=on or off
# for the mediad case
if test $BIT2SET = true
then
if test $FLOP_MEDIAPROG = /usr/etc/msdosd || egrep "^$FLOPPY" /etc/fsd.auto | grep -v mon=off > /dev/null
then
echo "\nAn entry exists for this floppy device in /etc/fsd.auto.
Do you wish to remove this entry? (y/n): \c"
getyesno
if test $ANSWER = yes
then
$FLOP_MEDIAPROG -r $FLOPPY
fi
fi
fi
fi # SKIP = false
fi # SKIP = false
else
echo "\nThere is no $FLOP_MEDIAPROGNAME running on this floppy device."
fi # ERR_CHECK = -1
fi # test $FLOPPY
fi
if test -n "$CD_MEDIAPROG"
then
# Get the CD drive device name. Allow blank entry
getcdrom
SKIP=false
# If CD-ROM device name entered, then do cdromd or mediad checks.
if test $CDROM
then
# Get the CD-ROM status with cdromd -q or mediad -q
# The return status is a bit mask. See the cdromd or
# mediad man page.
$CD_MEDIAPROG -q $CDROM
RETVAL=$?
# The bit program will set environment variables
# called BIT[0123]SET to either true or false depending
# on whether the corresponding bit is set.
eval `$SOFTWINDIR/bit $RETVAL`
# We now have the variables BIT[0123]SET set to either true
# or fale
# Bit 0 means error occurred
if test $BIT0SET = true
then
echo "\nAn error occurred while investigating the status of the CD-ROM drive.
No checking on the CD-ROM status will be done.
You may need to kill the $CD_MEDIAPROGNAME daemon manually."
elif test $RETVAL -ne 0
then
# Bit 1 means msdosd or mediad is running for that
# device
if test $BIT1SET = true
then
echo "\nDo you want to kill the $CD_MEDIAPROGNAME daemon attached to $CDROM ? (y/n): \c"
getyesno
if test $ANSWER = yes
then
if test $CD_MEDIAPROG = /usr/etc/cdromd
then
$CD_MEDIAPROG -k $CDROM
else
$CD_MEDIAPROG -k
fi
echo "Waiting for $CD_MEDIAPROGNAME to die..."
sleep 5
else
SKIP=true
fi
fi
if test $SKIP = false
then
# We have to test bit 3 before bit 2, because if the
# floppy has been mounted manually, then bit 2 will not
# be set even if there is an fsd.auto entry. So we
# do another cdromd -q to see if the cdrom has been
# unmounted, and use the return value of that to check
# for the fsd.auto entry.
# Bit 3 means the cdrom has been mounted manually
RDSK_NAME=`echo $CDROM | sed -e 's/\/dev\/scsi\/sc/\/dev\/dsk\/dks/' -e 's/l0$/s7/'`
if test $BIT3SET = true || mount | egrep "$RDSK_NAME|$CDROM" > /dev/null 2>&1
then
echo "\nThe CD-ROM device $CDROM has been mounted manually.
Would you like it unmounted? (y/n): \c"
getyesno
if test $ANSWER = yes
then
umount $RDSK_NAME > /dev/null 2>&1
umount $CDROM > /dev/null 2>&1
$CD_MEDIAPROG -q $CDROM
RETVAL=$?
eval `$SOFTWINDIR/bit $RETVAL`
if test $BIT3SET = true || mount | egrep "$RDSK_NAME|$CDROM" > /dev/null 2>&1
then
echo "\nThe unmount of the CD-ROM device $CDROM failed.
You will need to unmount the CD-ROM manually to use it with SoftWindows,
or you may access it as an FSA drive instead."
SKIP=true
fi
else
echo "\nIf you wish to use this CD-ROM drive with SoftWindows, you must either
unmount it manually, or you may use it as an FSA drive instead."
SKIP=true
fi
fi
if test $SKIP = false
then
# Bit 2 means there is an /etc/fsd.auto entry
# but we have to check whether mon=on or off
# for the mediad case.
if test $BIT2SET = true
then
if test $CD_MEDIAPROG = /usr/etc/cdromd || egrep "^$CDROM" /etc/fsd.auto | grep -v mon=off > /dev/null
then
echo "\nAn entry exists for this CD-ROM device in /etc/fsd.auto.
Do you wish to remove this entry? (y/n): \c"
getyesno
if test $ANSWER = yes
then
$CD_MEDIAPROG -r $CDROM
fi
fi
fi
fi # SKIP = false
fi
else
echo "\nThere is no $CD_MEDIAPROGNAME running on this CD-ROM device."
fi # ERR_CHECK = -1
fi # test $CDROM
fi
# All installed OK.
$SOFTWINDIR/InstallIt3
echo "\n\nTo run SoftWindows, use the \"Find icon\" workspace menu option, and
find the icon for /usr/lib/SoftWindows/bin/SoftWindows. Drag this icon onto
the desktop, and double click on it.
If you wish to run SoftWindows from a shell window, type the following:
/usr/lib/SoftWindows/bin/SoftWindows &
To use your floppy drive with SoftWindows, from the SoftWindows Options menu
select Disk Drives > Open Drive... In either of the floppy drive A: or B:
Device File Name boxes enter the floppy device name.
On an Indigo Enter /dev/rdsk/fds0d2.3.5hi for the middle slot
or /dev/rdsk/fds0d3.3.5hi for the top slot.
On an Indy Enter /dev/rdsk/fds0d2.3.5hi.
To use a CD-ROM drive, enter /dev/rdsk/dks0dXvol, where X is the SCSI address
of the drive, in the same dailog box.
This information is also in the file /usr/lib/SoftWindows/README.SGI
Press enter to exit this window.\c"
read ans
exit 0